package com.retirement.evaluate.controller;

import com.retirement.common.core.domain.AjaxResult;
import com.retirement.evaluate.domain.OldEvaluate;
import com.retirement.evaluate.service.IOldEvaluateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lijy
 * @since 2024-01-04
 */
@Api(value = "评价管理", tags = "评价管理")
@RequiredArgsConstructor
@RestController
@RequestMapping("/evaluate")
public class OldEvaluateController {

    private final IOldEvaluateService iOldEvaluateService;

    @PostMapping
    @ApiOperation(value = "新增员工评价")
    public AjaxResult addEvaluate(@RequestBody OldEvaluate dto){
        return AjaxResult.success(iOldEvaluateService.addEvaluate(dto));
    }

    @DeleteMapping("/{id}")
    @ApiOperation(value = "删除评鉴")
    public  AjaxResult deleteEvaluate(@PathVariable("id") String id){
        return AjaxResult.success(iOldEvaluateService.removeById(id));
    }

}
